function maxAdjacentDistance (nums: number[]): number {
  let result = Math.abs(nums[0] - nums[nums.length - 1]);
  for (let i = 0; i < nums.length - 1; i++) {
    result = Math.max(result, Math.abs(nums[i] - nums[i + 1]));
  }
  return result
}

export default function () {
  console.log(maxAdjacentDistance([1, 2, 4]))
}
